<?php
// Module Definition
$module['name'] = 'Spamassassin Panel';
$module['description'] = 'Manage users\' spamassassin settings.';

switch($action) {
	case 'register':
		$SQL = "CREATE TABLE IF NOT EXISTS `userpref` (
					username varchar(100) NOT NULL default '',
					preference varchar(30) NOT NULL default '',
					value varchar(100) NOT NULL default '',
					prefid int(11) NOT NULL auto_increment,
					PRIMARY KEY  (`prefid`),
					KEY `username` (`username`)
					) TYPE=MyISAM;";
		mysql_query($SQL);
		break;
	case 'unregister':
		$SQL = 'DROP TABLE IF EXISTS userpref';
		mysql_query($SQL);
		break;
	case 'enable':
		break;
	case 'disable':
		break;
	case 'hook':
		register_hook('web:cfg:default', 'sa_add_cfg');
		register_hook('web:menu', 'sa_add_menu');
		register_hook('web:lang', 'sa_add_lang');
		register_hook('web:personal:sapanel', 'sa_panel');
		break;
}
?>